#include <iostream>
#include <signal.h>
using namespace std;

void sigcb(int signum)
{
    cout << "my signum: " << signum << endl;
}

int main()
{
    struct sigaction sa;
    sa.sa_handler = sigcb;
    sigemptyset(&sa.sa_mask);
    sa.sa_flags = 0;
    sigaction(SIGINT, &sa, NULL);

    while (1)
    {
        sleep(1);
    }

    return 0;
}